/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*	
*	Julio Montes e-mail: imc.coder@gmail.com 
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef ALLIANCE_TOOL_H
#define ALLIANCE_TOOL_H

#include "sdk/include/filecfg.h"

namespace alliance
{
    typedef sdk::vectorElementsString vectorVariables;
    typedef sdk::vectorElementsString vectorOptions;
    typedef sdk::vectorElementsString vectorOthers;

    class Tool
    {
    public:
        static const wxString s_typeInput;
        static const wxString s_typeOutput;
        static const wxString s_typePattern;

        Tool( const wxString &command, const wxString &commandFormat );
        virtual ~Tool();

        const wxString &GetName() const;

        void Save( sdk::FileConfig *fileConfig );

        bool Load( const sdk::vectorElementsString &vectorElements );

        wxString GetCommandForFile() const;

        wxString GetFileByType( const wxString &type ) const;

        void AddVariable( const wxString &name, const wxString &value );
        void AddOption( const wxString &value, const wxString &additional=wxEmptyString );
        void AddOther( const wxString &name, const wxString &value, const wxString &type );

        const vectorVariables &GetVariables() const;
        const vectorOptions &GetOptions() const;
        const vectorOthers &GetOthers() const;
    protected:
    private:
        vectorVariables m_vectorVariables;
        vectorOptions m_vectorOptions;
        vectorOthers m_vectorOthers;
        wxString m_command;
        wxString m_commandFormat;

        void AddOption( const sdk::vectorAttributesString &vectorAttributes );
        void AddVariable( const sdk::vectorAttributesString &vectorAttributes );
        void AddOther( const wxString &name, const sdk::vectorAttributesString &vectorAttributes );
    };
}

#endif //ALLIANCE_TOOL_H
